Floats have decimal points, integers don't.
In [1]:
a = 496 # This is a perfect number, and an integer
type(a) # verify type is int
Out[1]:
In [ ]:
a # show contents of variable a
In [ ]:
print(a) # another way to show contents of variable a
In [ ]:
e = 2.7118281828 # This one has a decimal, so its type is float
type(e)
Complex numbers $\Bbb{C}$ are expressed as a + bj in Python, not a + bi.
In [ ]:
z = 2 - 6.1j
type(z)
In [ ]:
z.real # Get the real part a
In [ ]:
type(z.real) # The real part is type float even though it was entered as 2
In [ ]:
z.imag # Get the imaginary part
In [ ]:
y = -1 + 3j ; y # Python adds parens around complex numbers
In [ ]:
print(y + z) # Shows some weirdness for floats
In [ ]: